
#include "VertexElement.h"

using namespace Riccsson::Xna::Framework::Graphics;


PROP3_GET_CPP(VertexElement, int, Offset)
{
	return this->_offset;
}
PROP3_SET_CPP(VertexElement, int, Offset)
{
	this->_offset = value;
}

PROP3_GET_CPP(VertexElement, VertexElementFormat, vertexElementFormat)
{
	return this->_format;
}
PROP3_SET_CPP(VertexElement, VertexElementFormat, vertexElementFormat)
{
	this->_format = value;
}

PROP3_GET_CPP(VertexElement, VertexElementUsage, vertexElementUsage)
{
	return this->_usage;
}
PROP3_SET_CPP(VertexElement, VertexElementUsage, vertexElementUsage)
{
	this->_usage = value;
}
        
PROP3_GET_CPP(VertexElement, int, UsageIndex)
{
	return this->_usageIndex;
}
PROP3_SET_CPP(VertexElement, int, UsageIndex)
{
	this->_usageIndex = value;
}
        
VertexElement::VertexElement()
	: PROP3_INIT(VertexElement, Offset)
	, PROP3_INIT(VertexElement, vertexElementFormat)
	, PROP3_INIT(VertexElement, vertexElementUsage)
	, PROP3_INIT(VertexElement, UsageIndex)
{
	Offset = 0;
	vertexElementFormat = VertexElementFormat::Vector4;
	vertexElementUsage = VertexElementUsage::Color;
	UsageIndex = 0;
}

VertexElement::VertexElement(int offset, VertexElementFormat elementFormat, VertexElementUsage elementUsage, int usageIndex)
	: PROP3_INIT(VertexElement, Offset)
	, PROP3_INIT(VertexElement, vertexElementFormat)
	, PROP3_INIT(VertexElement, vertexElementUsage)
	, PROP3_INIT(VertexElement, UsageIndex)
{
	Offset = offset;
	vertexElementFormat = elementFormat;
	vertexElementUsage = elementUsage;
	UsageIndex = usageIndex;
}

int VertexElement::GetHashCode()
{
	// TODO: Fix hashes
	return 0;
}

GC_PTR<Riccsson::System::string> VertexElement::ToString() const
{
	//return string.Format("{{Offset:{0} Format:{1} Usage:{2} UsageIndex:{3}}}", new object[] { this->Offset, this->VertexElementFormat, this->VertexElementUsage, this->UsageIndex });
	throw;
}

bool VertexElement::Equals(const Riccsson::System::object* obj)
{
	//if (obj == null)
	//{
	//	return false;
	//}
	//if (obj.GetType() != base.GetType())
	//{
	//	return false;
	//}
	//return (this == ((VertexElement)obj));
	throw;
}

//bool operator ==(const VertexElement& left, const VertexElement& right)
//{
//	return ((((left._offset == right._offset) && (left._usageIndex == right._usageIndex)) && (left._usage == right._usage)) && (left._format == right._format));
//}
//
//bool operator !=(const VertexElement& left, const VertexElement& right)
//{
//	return !( ((((left._offset == right._offset) && (left._usageIndex == right._usageIndex)) && (left._usage == right._usage)) && (left._format == right._format)) );
//}